package com.neiquan.backstage.meeting_order.imp;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neiquan.backstage.common.util.ExtraSpringHibernateTemplate;
import com.neiquan.backstage.meeting_order.MeetingOrderService;
import com.neiquan.backstage.pub.bsc.dao.po.MeetingOrder;

@Service
public class MeetingOrderServiceImp implements MeetingOrderService {
	private static Class<?> poc = MeetingOrder.class;
	@Autowired
	private ExtraSpringHibernateTemplate extraSpringHibernateTemplate;

	@Override
	public MeetingOrder queryById(Integer id) {
		return extraSpringHibernateTemplate.findFirstOneByPropEq(poc, "meetingOrderId", id);
	}
	
	/**
	 * 查询某个user下的会议预约
	 */
	@Override
	public List<MeetingOrder> queryByUserId(Integer userId, Integer memberId) {
		// TODO Auto-generated method stub
		return (List<MeetingOrder>) extraSpringHibernateTemplate
				.getHibernateTemplate()
				.find("From MeetingOrder where userId=? and memberId=?", userId,memberId);
	}

}
